package com.joker.yuwu;

import com.joker.repository.RootCreatZg;
import net.sf.json.JSONObject;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/rootcreatzg")
public class RootCreatZhanguan extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        super.doGet(req, resp);
        req.setCharacterEncoding("utf-8");
        String name=req.getParameter("name");
        String xinxi=req.getParameter("xinxi");
//        String zhuangtai=req.getParameter("zhuangtai");
        RootCreatZg r1=new RootCreatZg();
//        创建展馆,默认状态是0
        boolean b1=r1.creat(name,xinxi,"0");
        JSONObject obj=new JSONObject();
        obj.put("data",b1);
        resp.getWriter().write(obj.toString());

    }



    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        super.doPost(req, resp);
    }
}
